package test;

public class ThreadConsumer implements Runnable{
	private ThreadStorage storage;
	private static int id = 0;
	private int currId = id++;
	
	public ThreadConsumer(ThreadStorage storage){
		this.storage = storage;
		
	}
	
	@Override
	public void run() {
		while(true){
			Thread.currentThread().setName("Consumer--" + currId);
			storage.pop();
			try {
				Thread.sleep(10000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
